/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = t_frct_init.c                                      */
/*  NOTE      =                                                    */
/*  DATE      = 2014/12/17 by geyh                                 */
/*******************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <CUnit/Basic.h>
#include <CUnit/CUnit.h>

#include "frcomm.h"
#include "frlog.h"
#include "frmem.h"
#include "frlist.h"
#include "frsutl.h"
#include "frhash2.h"
#include "conntrack.h"
#include "frct_comm.h"
#include "frct_mng.h"
#include "apmtest_cunit.h"

static int __suite_init(void)
{
	return 0;
}

static int __suite_cleanup(void)
{
	return 0;
}

extern Frhash_header        *g_p_st_hash_ct;
extern unsigned long g_ul_ct_max;
extern unsigned long g_ul_queue_max;
extern unsigned long g_ul_tcp_est_timeout;
extern unsigned long g_ul_tcp_syn_timeout;
extern unsigned long g_ul_udp_est_timeout;

static void __case1(void)
{
    int i_ret = 0;
    unsigned int ui_table_size = 65534;

    i_ret = frct_init(ui_table_size);
    CU_ASSERT_EQUAL(i_ret,FR_SUCC);
    frct_destroy();
}

static void __case2(void)
{
    int i_ret = 0;
    unsigned int ui_table_size = 65535;

    i_ret = frct_init(ui_table_size);

    CU_ASSERT_EQUAL(i_ret,FR_SUCC);
    frct_destroy();
}

int add_suite()
{
	CU_pSuite pSuite = NULL;

	pSuite = CU_add_suite("t_frct_init 测试", __suite_init, __suite_cleanup);

	if (NULL == pSuite)
	{
		return 1;
	}


    //增加测试用例
   	CU_add_test(pSuite, "case1", __case1);
   	CU_add_test(pSuite, "case2", __case2);

    return 0;

}


int main(int argc, char **argv)
{
    fr_slab_init(52428800, "test");
    run_cunit(add_suite);
    fr_slab_destroy();

    return 0;
}